﻿using System.Collections.Generic;
using System.Linq;
namespace Athena.RouteAddress
{
    public class ServiceMultipleRouteDescriptor
    {
        public IEnumerable<ServiceRouteDescriptor> RouteDescriptors { get; set; }

        public ServiceDescriptor ServiceDescriptor { get; set; }


        public ServiceMultipleRoute ConvertToServiceMultipleRoute(IRouteDescriptorChanger routeDescriptorChanger)
        {
            return new ServiceMultipleRoute()
            {
                ServiceDescriptor = ServiceDescriptor,
                ServiceRoutes = RouteDescriptors.Select(routeDescriptor => routeDescriptorChanger.CreateServiceRoute(routeDescriptor))
            };
        }
    }
}
